package model

import (
	"gorm.io/gorm"
	"time"
)

type Message struct {
	Id        uint32         `gorm:"column:id;type:int UNSIGNED;comment:公告ID;primaryKey;not null;" form:"id" json:"id"`                                          // 公告ID
	Title     string         `gorm:"column:title;type:varchar(60);comment:标题;not null;" form:"title" json:"title"`                                               // 标题
	Content   string         `gorm:"column:content;type:varchar(300);comment:内容;not null;" form:"content" json:"content"`                                        // 内容
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);comment:发送时间;not null;default:CURRENT_TIMESTAMP(3);" form:"created_at" json:"created_at"` // 发送时间
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);comment:修改时间;not null;default:CURRENT_TIMESTAMP(3);" form:"updated_at" json:"updated_at"` // 修改时间
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" form:"deleted_at" json:"deleted_at"`
}

func (m *Message) TableName() string {
	return "message"
}
